USE BMIG_Mensual_POST_CADENA
go
IF OBJECT_ID('dbo.WASP_M0016_Drop_tables') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.WASP_M0016_Drop_tables
    IF OBJECT_ID('dbo.WASP_M0016_Drop_tables') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.WASP_M0016_Drop_tables >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.WASP_M0016_Drop_tables >>>'
END
go
SET ANSI_NULLS ON
go
SET QUOTED_IDENTIFIER ON
go
CREATE PROCEDURE WASP_M0016_Drop_tables

AS
BEGIN
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[as_seg_vida_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[as_seg_vida_temp]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sv_codigos_seguros]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[sv_codigos_seguros]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sv_valores_seguros]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[sv_valores_seguros]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sv_seguros]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[sv_seguros]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sv_seguro_vida_tra]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[sv_seguro_vida_tra]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[as_cuotas_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[as_cuotas_temp]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sv_seg_vida]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[sv_seg_vida]

END
go
SET ANSI_NULLS OFF
go
SET QUOTED_IDENTIFIER OFF
go
IF OBJECT_ID('dbo.WASP_M0016_Drop_tables') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.WASP_M0016_Drop_tables >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.WASP_M0016_Drop_tables >>>'
go
